package com.app.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import com.app.biz.AppInfoBiz;
import com.app.biz.BackendUserBiz;
import com.app.dao.AppInfoDao;
import com.app.entity.AppInfo;
import com.app.entity.AppVersion;

@Service("appInfoBiz")
public class AppInfoBizImpl implements AppInfoBiz {

	@Autowired
	private AppInfoDao appInfoDao;
	
   public static void main(String[] args) {
	   ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans.xml");
		AppInfoBiz backendUserBiz = (AppInfoBiz) applicationContext.getBean("appInfoBiz");
		AppInfo appInfo =backendUserBiz.getVersion(51);
		System.out.println(backendUserBiz.getVersion(51));
//		List<AppInfo> list =backendUserBiz.getAppInfoPage(0, 0,0,0,"", 0,"", 1,5);
//     	System.out.println(list.size());
//		for(AppInfo appInfo:list){
//			System.out.println(appInfo.getSoftwareName());
//		}
}
public List<AppInfo> getAppInfoPage(int id, int categoryLevel1,
		int categoryLevel2, int categoryLevel3, String softwareName,
		int status, int flatformId, int startIndex, int pageSize) {
	// TODO Auto-generated method stub
	return appInfoDao.getAppInfoPage(id, categoryLevel1, categoryLevel2, categoryLevel3, softwareName, status, flatformId, startIndex, pageSize);
}
public int getRowsCount(int cid, int categoryLevel1, int categoryLevel2,
		int categoryLevel3, String softwareName, int status, int flatformId) {
	// TODO Auto-generated method stub
	return appInfoDao.getRowsCount(cid, categoryLevel1, categoryLevel2, categoryLevel3, softwareName, status, flatformId);
}
public AppInfo getById(int id) {
	// TODO Auto-generated method stub
	return appInfoDao.getById(id);
}


public int addInfo(AppInfo appInfo) {
	// TODO Auto-generated method stub
	return appInfoDao.addInfo(appInfo);
}
public void update(AppInfo appInfo) {
	// TODO Auto-generated method stub
	
	appInfoDao.update(appInfo);
}



public List<AppInfo> getAppInfo(int id) {
	// TODO Auto-generated method stub
	return appInfoDao.getAppInfo(id);
}
public int deleteAppInfo(int id) {
	// TODO Auto-generated method stub
	return appInfoDao.deleteAppInfo(id);

}
public AppInfo getVersion(int id) {
	// TODO Auto-generated method stub
	return appInfoDao.getVersion(id);
}

public int updateflatform(int status,int id) {
	// TODO Auto-generated method stub
	return appInfoDao.updateflatform(status,id);
}
public List<AppInfo> getAppInfoPageByStatus(int id, int categoryLevel1,
		int categoryLevel2, int categoryLevel3, String softwareName,
		int status, int flatformId, int startIndex, int pageSize) {
	// TODO Auto-generated method stub
	return appInfoDao.getAppInfoPageByStatus(id, categoryLevel1, categoryLevel2, categoryLevel3, softwareName, status, flatformId, startIndex, pageSize);
}
public int updateInfoByStatus(int id) {
	// TODO Auto-generated method stub
	return appInfoDao.updateInfoByStatus(id);
}
public int getRowsCount1(int cid, int categoryLevel1, int categoryLevel2,
		int categoryLevel3, String softwareName, int status, int flatformId) {
	// TODO Auto-generated method stub
	return appInfoDao.getRowsCount1(cid, categoryLevel1, categoryLevel2, categoryLevel3, softwareName, status, flatformId);

}







}
